function resizeImages()
{
	var width;
	if(self.innerWidth)
		width = self.innerWidth;
	else if(document.documentElement && document.documentElement.clientWidth)
		width = document.documentElement.clientWidth;
	else if(document.body)
		width = document.body.clientWidth;

	var ratio = width / old_width;
	//image_count = ".count($_FOCUS['Menu']).";
	if(ratio!=0 && ratio!=null)
	{
		for(i=0;i<document.images.length;i++)
			document.images[i].width = Math.round(document.images[i].width * ratio);
	}
	
	old_width = width;
	return true;
}

function getSize()
{
	if(self.innerWidth)
		old_width = self.innerWidth;
	else if(document.documentElement && document.documentElement.clientWidth)
		old_width = document.documentElement.clientWidth;
	else if(document.body)
		old_width = document.body.clientWidth;

	return true;
}

function openModcat(modcat)
{
	opened = true;

	if(old_modcat==modcat)
	{
		document.getElementById("menu_hidden"+old_modcat).style.visibility = "hidden";
		document.getElementById("button_"+old_modcat).style.backgroundColor = "transparent";
		document.getElementById("button_"+old_modcat).style.color = '#000000';
		opened = false
		return;
	}

	if(old_modcat!=false)
	{
		document.getElementById("menu_hidden"+old_modcat).style.visibility = "hidden";
		document.getElementById("button_"+old_modcat).style.backgroundColor = "transparent";
		document.getElementById("button_"+old_modcat).style.color = document.getElementById("button_"+modcat).style.color;
	}
	document.getElementById("button_"+modcat).style.backgroundColor = highlightColor;
	document.getElementById("button_"+modcat).style.color = '#FFFFFF';	
	document.getElementById("menu_hidden"+modcat).style.visibility = 'visible';

	if(old_modcat==modcat)
		old_modcat = false;
	else
		old_modcat = modcat;
}

function openRollover(modcat)
{
	if(old_modcat!=false && old_modcat!=modcat)
	{
		document.getElementById("menu_hidden"+old_modcat).style.visibility = "hidden";
		document.getElementById("button_"+old_modcat).style.backgroundColor = "transparent";
		document.getElementById("button_"+old_modcat).style.color = document.getElementById("button_"+modcat).style.color;
		document.getElementById("menu_hidden"+modcat).style.visibility = 'visible';
		document.getElementById("button_"+modcat).style.backgroundColor = highlightColor;
		document.getElementById("button_"+modcat).style.color = '#FFFFFF';	
		old_modcat = modcat;				
	}
}